<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>首页</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
  </head>
  <body>
  	<h2 align="center">会员管理</h2>
  	<sf:form align="center" action="look" id="frm" modelAttribute="page" method="get">
  		<sf:hidden id="pageNo" path="pageNo" />
  	
  	<table align="center" width="450px" border="1px">
  		<thead>
  			<tr>
  				 <th colspan="5">
  				 	用户名：<sf:input path="cond['cond']" />
  				 	<input type="button" value="查找" onclick="toPage(1)" />		 
  				</th>
  			</tr>
  			<tr>
  				<th>序号</th>
  				<th>用户名</th>
  				<th>用户类别</th>
  				<th>用户状态</th>
  				<th>最后修改时间</th>
  			</tr>
  		</thead>
  		<tbody align="center">
  			<c:forEach items="${page.list }" var="b">
  				<tr>
  					<td>${b.id }</td>
  					<td>${b.name }</td>
  					<td>${b.type_id ==1?'普通用户':'管理员' }</td>
  					<td>${b.status ==1?'正常':'冻结' }</td>
  					<td><fmt:formatDate value="${b.last_modify_time }" pattern="yyyy-MM-dd"/> </td>
  				</tr>
  			</c:forEach>
  		</tbody>
  		<tfoot>
  			<tr>
  				<td align="center" colspan="5">
  					<a href="javascript:toPage(1)">首页</a>
  					<a href="javascript:toPage(${page.prev })">上一页</a>
	  				
	  				<a href="javascript:toPage(${page.next })">下一页</a>
	  				<a href="javascript:toPage(${page.pageTotal })">末页</a>
	  				第${page.pageNo }页 / 共${page.pageTotal }页(${page.total }条记录)
	  			</td>
  			</tr>
  		</tfoot>
  	</table>
  	</sf:form>
  </body>
  <script type="text/javascript" src="res/js/jquery-1.8.3.js"></script>
  <script type="text/javascript">
  	$(function(){
  		$('#span').css('align','left')
  		$('thead tr:eq(1)').css('backgroundColor','#AFDBE6')
  		$("tbody tr:odd").css('backgroundColor',"#92EF98")
  		window.toPage = function(pageNo){
  			$('#pageNo').val(pageNo);
  			$('#frm')[0].submit();
  		}
  	});
  </script>
</html>
